package com.qingyun.edusysteam.controller;

import com.qingyun.edusysteam.dto.Result;
import com.qingyun.edusysteam.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 学生表 前端控制器
 * </p>
 *
 * @author your_name
 * @since 2025-08-23
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;
    @GetMapping("/studentInfo")
    public Result studentInfo(
            @RequestHeader("Authorization") String token,
            @RequestParam(value = "keyword", required = false,defaultValue = "") String keyword
    ) {
        if(token.isEmpty()){
            return Result.fail("获取用户失败，请联系管理员");
        }
        return studentService.studentInfo(token,keyword);
    }
}
